package com.dailywork.basepro.proxy;

public class CountProxy implements CountService {

    private CountServiceImpl countServiceImpl;

    public CountProxy(CountServiceImpl countServiceImpl) {
        this.countServiceImpl = countServiceImpl;
    }

    @Override
    public void queryCount() {
        System.out.println("事务处理之前");
        // 调用委托类的方法;
        countServiceImpl.queryCount();
        System.out.println("事务处理之后");
    }

    @Override
    public void updateCount() {
        System.out.println("事务处理之前");
        // 调用委托类的方法;
        countServiceImpl.updateCount();
        System.out.println("事务处理之后");
    }
}
